<template>
  <div>
    待映电影
    <ul>
      <li v-for="(value, key) in daiyingList" :key="key">
        <div>{{ key }}</div>
        <ul>
          <li v-for="item in value" :key="item.id">
            {{ item.nm }}
          </li>
        </ul>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "wait",
  data: function () {
    return {
      daiyingList: [],
    };
  },
  mounted() {
    console.log(15);
    axios
      .get(
        "/ajax/comingList?ci=30&token=uxYB5q3yS4sD6xoCU1d5V5xEqkwAAAAA6g0AAFziAXwhVjP2QJca-0F-UpwZ-sJ7klWzyakYKREBxSnlzA59lY01wazJo694a_rysw&limit=10&optimus_uuid=9301B8F0D8A111EBB376757321755EB7A2F821BBA2B047FE86EE9833C24FC202&optimus_risk_level=71&optimus_code=10"
      )
      .then((res) => {
        console.log(res);
        var daiyingList = res.data.coming;
        var daiying = {};
        daiyingList.forEach((item) => {
          if (daiying[item.comingTitle]) {
            daiying[item.comingTitle].push(item);
          } else {
            daiying[item.comingTitle] = [];
            daiying[item.comingTitle].push(item);
          }
        });
        this.daiyingList = daiying;
      });
  },
};
</script>

<style>
</style>